package com.hxj.docking.service.impl;

import com.hxj.docking.pojo.dto.ReceiveDataDTO;
import com.hxj.docking.pojo.dto.ReceiveResultDTO;
import com.hxj.docking.service.ReceiveService;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Author hxj
 * @Date 2024/12/5 15:36
 * @Description
 */
@Component
public class ReceiveServiceImpl implements ReceiveService {


    @Override
    public ReceiveResultDTO checkSafety(ReceiveDataDTO receiveDataDTO) {
        ReceiveResultDTO receiveResultDTO = new ReceiveResultDTO();
        // TODO 验签
        receiveResultDTO.setCODE("200");
        return receiveResultDTO;
    }

    @Override
    public ReceiveResultDTO receiveData(ReceiveDataDTO receiveDataDTO) {
        ReceiveResultDTO receiveResultDTO = new ReceiveResultDTO();
        // 接口鉴权 解密 验签等

        // 通过接口代码获取接口类型枚举实体
        String serviceCode = receiveDataDTO.getServiceCode();
        Map<String, Object> data = receiveDataDTO.getData();

        // 对数据进行初步校验 如果校验不通过直接返回 不用进入队列组件


        // 初步校验没问题的 压入队列组件 返回taskId


        return receiveResultDTO;
    }
}
